<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <meta name="Content-Type" content="text/html; charset=UTF-8" />
<title>Class: Sass::Importers::Filesystem</title>
<link rel="stylesheet" href="style.css" tppabs="http://sass-lang.com/docs/yardoc/css/style.css" type="text/css" media="screen" charset="utf-8" />
<link rel="stylesheet" href="common.css" tppabs="http://sass-lang.com/docs/yardoc/css/common.css" type="text/css" media="screen" charset="utf-8" />

<script type="text/javascript" charset="utf-8">
  relpath = '../..';
  if (relpath != '') relpath += '/';
</script>
<script type="text/javascript" charset="utf-8" src="jquery.js" tppabs="http://sass-lang.com/docs/yardoc/js/jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="app.js" tppabs="http://sass-lang.com/docs/yardoc/js/app.js"></script>

  </head>
  <body>
    <script type="text/javascript" charset="utf-8">
      if (window.top.frames.main) document.body.className = 'frames';
    </script>
    
    <div id="header">
      <div id="menu">
  
    <a href="_index.html" tppabs="http://sass-lang.com/docs/yardoc/_index.html">Index (F)</a> &raquo; 
    <span class='title'><a href="Sass-1.html" tppabs="http://sass-lang.com/docs/yardoc/Sass.html" title="Sass (module)">Sass</a></span> &raquo; <span class='title'><a href="Importers.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Importers.html" title="Sass::Importers (module)">Importers</a></span>
     &raquo; 
    <span class="title">Filesystem</span>
  
  
  <div class="noframes"><span class="title">(</span><a href="javascript:if(confirm(%27http://sass-lang.com/docs/yardoc/Sass/Importers/.  \n\nThis file was not retrieved by Teleport Pro, because the server reports that this file cannot be found.  \n\nDo you want to open it from the server?%27))window.location=%27http://sass-lang.com/docs/yardoc/Sass/Importers/.%27" tppabs="http://sass-lang.com/docs/yardoc/Sass/Importers/." target="_top">no frames</a><span class="title">)</span></div>
</div>

      <div id="search">
  <a id="class_list_link" href="#">Class List</a>
  <a id="method_list_link" href="#">Method List</a>
  <a id ="file_list_link" href="#">File List</a>
</div>

      <div class="clear"></div>
    </div>
    
    <iframe id="search_frame"></iframe>
    
    <div id="content"><h1>Class: Sass::Importers::Filesystem 
  
  
</h1>

<dl class="box">
  
    <dt class="r1">Inherits:</dt>
    <dd class="r1">
      <span class="inheritName"><a href="Base-3.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Importers/Base.html" title="Sass::Importers::Base (class)">Base</a></span>
      
        <ul class="fullTree">
          <li>Object</li>
          
            <li class="next"><a href="Base-3.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Importers/Base.html" title="Sass::Importers::Base (class)">Base</a></li>
          
            <li class="next">Sass::Importers::Filesystem</li>
          
        </ul>
        <a href="#" class="inheritanceTree">show all</a>
      
      </dd>
    
  
  
    
  
    
  
  
    <dt class="r2 last">Defined in:</dt>
    <dd class="r2 last">/var/www/sass-pages/.sass/lib/sass/importers/filesystem.rb</dd>
  
</dl>
<div class="clear"></div>

<h2>Overview</h2><div class="docstring">
  <div class="discussion">
    <p>The default importer, used for any strings found in the load path. Simply loads Sass files from the filesystem using the default logic.</p>

  </div>
</div>
<div class="tags">
  
</div>
  <h2>Constant Summary</h2>
  


  
  
  
  
  <h2>Instance Attribute Summary</h2>
  <ul class="summary">
    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#root-instance_method" title="#root (instance method)">- <strong>root</strong> </a>
    

    
  </span>
  
  
    
    
  
  
  
  

  
    <span class="summary_desc">Returns the value of attribute root.</span>
  
</li>

    
  </ul>


  <h2>Instance Method Summary</h2>

  <ul class="summary">
    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#eql%3F-instance_method" title="#eql? (instance method)">- (Boolean) <strong>eql?</strong>(other) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc"></span>
  
</li>

    
      <li class="protected ">
  <span class="summary_signature">
    
      <a href="#escape_glob_characters-instance_method" title="#escape_glob_characters (instance method)">- <strong>escape_glob_characters</strong>(name) </a>
    

    
  </span>
  
  
  <span class="note title protected">protected</span>
  
  

  
    <span class="summary_desc"></span>
  
</li>

    
      <li class="protected ">
  <span class="summary_signature">
    
      <a href="#extensions-instance_method" title="#extensions (instance method)">- ({String =&gt; Symbol}) <strong>extensions</strong> </a>
    

    
  </span>
  
  
  <span class="note title protected">protected</span>
  
  

  
    <span class="summary_desc">A hash from file extensions to the syntaxes for those extensions.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#find-instance_method" title="#find (instance method)">- <strong>find</strong>(name, options) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc"></span>
  
</li>

    
      <li class="protected ">
  <span class="summary_signature">
    
      <a href="#find_real_file-instance_method" title="#find_real_file (instance method)">- ((String, Symbol)) <strong>find_real_file</strong>(dir, name, options) </a>
    

    
  </span>
  
  
  <span class="note title protected">protected</span>
  
  

  
    <span class="summary_desc">Given a base directory and an <code>@import</code>ed name, finds an existant file that matches the name.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#find_relative-instance_method" title="#find_relative (instance method)">- <strong>find_relative</strong>(name, base, options) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc"></span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#hash-instance_method" title="#hash (instance method)">- <strong>hash</strong> </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc"></span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#initialize-instance_method" title="#initialize (instance method)">- (Filesystem) <strong>initialize</strong>(root) </a>
    

    
  </span>
  
    <span class="note title constructor">constructor</span>
  
  
  
  
  

  
    <span class="summary_desc">Creates a new filesystem importer that imports files relative to a given path.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#key-instance_method" title="#key (instance method)">- <strong>key</strong>(name, options) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc"></span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#mtime-instance_method" title="#mtime (instance method)">- <strong>mtime</strong>(name, options) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc"></span>
  
</li>

    
      <li class="protected ">
  <span class="summary_signature">
    
      <a href="#possible_files-instance_method" title="#possible_files (instance method)">- (Array(String, Symbol)) <strong>possible_files</strong>(name) </a>
    

    
  </span>
  
  
  <span class="note title protected">protected</span>
  
  

  
    <span class="summary_desc">Given an <code>@import</code>ed path, returns an array of possible on-disk filenames and their corresponding syntaxes for that path.</span>
  
</li>

    
      <li class="protected ">
  <span class="summary_signature">
    
      <a href="#remove_root-instance_method" title="#remove_root (instance method)">- <strong>remove_root</strong>(name) </a>
    

    
  </span>
  
  
  <span class="note title protected">protected</span>
  
  

  
    <span class="summary_desc">If a full uri is passed, this removes the root from it otherwise returns the name unchanged.</span>
  
</li>

    
      <li class="protected ">
  <span class="summary_signature">
    
      <a href="#split-instance_method" title="#split (instance method)">- <strong>split</strong>(name) </a>
    

    
  </span>
  
  
  <span class="note title protected">protected</span>
  
  

  
    <span class="summary_desc">Splits a filename into three parts, a directory part, a basename, and an extension Only the known extensions returned from the extensions method will be recognized as such.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#to_s-instance_method" title="#to_s (instance method)">- <strong>to_s</strong> </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc"></span>
  
</li>

    
  </ul>

  
  
  
  
  <div id="constructor_details" class="method_details_list">
  <h2>Constructor Details</h2>
  
    <div class="method_details first">
  <p class="signature first" id="initialize-instance_method">
  
    - (<tt><a href="" title="Sass::Importers::Filesystem (class)">Filesystem</a></tt>) <strong>initialize</strong>(root) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Creates a new filesystem importer that imports files relative to a given path.</p>

  </div>
</div>
<div class="tags">
  <h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt>String</tt>)</span>
      
      
        <span class='name'>root</span>
      
      
      
        &mdash;
        The root path. This importer will import files relative to this path.
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


16
17
18
19</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/importers/filesystem.rb', line 16</span>

def initialize(root)
  @root = File.expand_path(root)
  @same_name_warnings = Set.new
end</pre>
    </td>
  </tr>
</table>
</div>
  
</div>

  <div id="instance_attr_details" class="attr_details">
    <h2>Instance Attribute Details</h2>
    
      
      <span id="root=-instance_method"></span>
      <span id="root-instance_method"></span>
      <div class="method_details first">
  <p class="signature first" id="root-instance_method">
  
    - <strong>root</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Returns the value of attribute root</p>

  </div>
</div>
<div class="tags">
  
</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


10
11
12</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/importers/filesystem.rb', line 10</span>

def root
  @root
end</pre>
    </td>
  </tr>
</table>
</div>
    
  </div>


  <div id="instance_method_details" class="method_details_list">
    <h2>Instance Method Details</h2>
    
    
      <div class="method_details first">
  <p class="signature first" id="eql?-instance_method">
  
    - (<tt>Boolean</tt>) <strong>eql?</strong>(other) 
  

  
</p><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  <h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt>Boolean</tt>)</span>
      
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


54
55
56</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/importers/filesystem.rb', line 54</span>

def eql?(other)
  root.eql?(other.root)
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="escape_glob_characters-instance_method">
  
    - <strong>escape_glob_characters</strong>(name)  <span class="extras">(protected)</span>
  

  
</p><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


104
105
106
107
108</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/importers/filesystem.rb', line 104</span>

def escape_glob_characters(name)
  name.gsub(/[\*\[\]\{\}\?]/) do |char|
    "\\#{char}"
  end
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="extensions-instance_method">
  
    - (<tt>{String =&gt; Symbol}</tt>) <strong>extensions</strong>  <span class="extras">(protected)</span>
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>A hash from file extensions to the syntaxes for those extensions. The syntaxes must be <code>:sass</code> or <code>:scss</code>.</p>

<p>This can be overridden by subclasses that want normal filesystem importing with unusual extensions.</p>

  </div>
</div>
<div class="tags">
  <h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt>{String =&gt; Symbol}</tt>)</span>
      
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


77
78
79</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/importers/filesystem.rb', line 77</span>

def extensions
  {'sass' => :sass, 'scss' => :scss}
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="find-instance_method">
  
    - <strong>find</strong>(name, options) 
  

  
</p><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  
  <h3>See Also:</h3>
  <ul class="see">
    
      <li><a href="Base-3.html#find-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Importers/Base.html#find-instance_method" title="Sass::Importers::Base#find (method)">Base#find</a></li>
    
  </ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


27
28
29</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/importers/filesystem.rb', line 27</span>

def find(name, options)
  _find(@root, name, options)
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="find_real_file-instance_method">
  
    - (<tt>(String, Symbol)</tt>) <strong>find_real_file</strong>(dir, name, options)  <span class="extras">(protected)</span>
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Given a base directory and an <code>@import</code>ed name, finds an existant file that matches the name.</p>

  </div>
</div>
<div class="tags">
  <h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt>String</tt>)</span>
      
      
        <span class='name'>dir</span>
      
      
      
        &mdash;
        The directory relative to which to search.
      
    </li>
  
    <li>
      
        <span class='type'>(<tt>String</tt>)</span>
      
      
        <span class='name'>name</span>
      
      
      
        &mdash;
        The filename to search for.
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt>(String, Symbol)</tt>)</span>
      
      
      
      
        &mdash;
        A filename-syntax pair.
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/importers/filesystem.rb', line 117</span>

def find_real_file(dir, name, options)
  # on windows 'dir' can be in native File::ALT_SEPARATOR form
  dir = dir.gsub(File::ALT_SEPARATOR, File::SEPARATOR) unless File::ALT_SEPARATOR.nil?

  found = possible_files(remove_root(name)).map do |f, s|
    path = (dir == "." || Pathname.new(f).absolute?) ? f : "#{dir}/#{f}"
    Dir[path].map do |full_path|
      full_path.gsub!(REDUNDANT_DIRECTORY, File::SEPARATOR)
      [full_path, s]
    end
  end
  found = Sass::Util.flatten(found, 1)
  return if found.empty?

  if found.size > 1 && !@same_name_warnings.include?(found.first.first)
    found.each {|(f, _)| @same_name_warnings << f}
    relative_to = Pathname.new(dir)
    if options[:_line]
      # If _line exists, we're here due to an actual import in an
      # import_node and we want to print a warning for a user writing an
      # ambiguous import.
      candidates = found.map {|(f, _)| "    " + Pathname.new(f).relative_path_from(relative_to).to_s}.join("\n")
      Sass::Util.sass_warn "WARNING: On line \#{options[:_line]}\#{\" of \#{options[:filename]}\" if options[:filename]}:\n  It's not clear which file to import for '@import \"\#{name}\"'.\n  Candidates:\n\#{candidates}\n  For now I'll choose \#{File.basename found.first.first}.\n  This will be an error in future versions of Sass.\n"
    else
      # Otherwise, we're here via StalenessChecker, and we want to print a
      # warning for a user running `sass --watch` with two ambiguous files.
      candidates = found.map {|(f, _)| "    " + File.basename(f)}.join("\n")
      Sass::Util.sass_warn "WARNING: In \#{File.dirname(name)}:\n  There are multiple files that match the name \"\#{File.basename(name)}\":\n\#{candidates}\n"
    end
  end
  found.first
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="find_relative-instance_method">
  
    - <strong>find_relative</strong>(name, base, options) 
  

  
</p><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  
  <h3>See Also:</h3>
  <ul class="see">
    
      <li><a href="Base-3.html#find_relative-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Importers/Base.html#find_relative-instance_method" title="Sass::Importers::Base#find_relative (method)">Base#find_relative</a></li>
    
  </ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


22
23
24</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/importers/filesystem.rb', line 22</span>

def find_relative(name, base, options)
  _find(File.dirname(base), name, options)
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="hash-instance_method">
  
    - <strong>hash</strong> 
  

  
</p><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


50
51
52</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/importers/filesystem.rb', line 50</span>

def hash
  @root.hash
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="key-instance_method">
  
    - <strong>key</strong>(name, options) 
  

  
</p><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  
  <h3>See Also:</h3>
  <ul class="see">
    
      <li><a href="Base-3.html#key-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Importers/Base.html#key-instance_method" title="Sass::Importers::Base#key (method)">Base#key</a></li>
    
  </ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


40
41
42
43</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/importers/filesystem.rb', line 40</span>

def key(name, options)
  [self.class.name + ":" + File.dirname(File.expand_path(name)),
    File.basename(name)]
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="mtime-instance_method">
  
    - <strong>mtime</strong>(name, options) 
  

  
</p><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  
  <h3>See Also:</h3>
  <ul class="see">
    
      <li><a href="Base-3.html#mtime-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Importers/Base.html#mtime-instance_method" title="Sass::Importers::Base#mtime (method)">Base#mtime</a></li>
    
  </ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


32
33
34
35
36
37</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/importers/filesystem.rb', line 32</span>

def mtime(name, options)
  file, _ = Sass::Util.destructure(find_real_file(@root, name, options))
  File.mtime(file) if file
rescue Errno::ENOENT
  nil
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="possible_files-instance_method">
  
    - (<tt>Array(String, Symbol)</tt>) <strong>possible_files</strong>(name)  <span class="extras">(protected)</span>
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Given an <code>@import</code>ed path, returns an array of possible on-disk filenames and their corresponding syntaxes for that path.</p>

  </div>
</div>
<div class="tags">
  <h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt>String</tt>)</span>
      
      
        <span class='name'>name</span>
      
      
      
        &mdash;
        The filename.
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt>Array(String, Symbol)</tt>)</span>
      
      
      
      
        &mdash;
        An array of pairs. The first element of each pair is a filename to look for; the second element is the syntax that file would be in (<code>:sass</code> or <code>:scss</code>).
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


88
89
90
91
92
93
94
95
96
97
98
99
100
101
102</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/importers/filesystem.rb', line 88</span>

def possible_files(name)
  name = escape_glob_characters(name)
  dirname, basename, extname = split(name)
  sorted_exts = extensions.sort
  syntax = extensions[extname]

  if syntax
    ret = [["#{dirname}/{_,}#{basename}.#{extensions.invert[syntax]}", syntax]]
  else
    ret = sorted_exts.map {|ext, syn| ["#{dirname}/{_,}#{basename}.#{ext}", syn]}
  end

  # JRuby chokes when trying to import files from JARs when the path starts with './'.
  ret.map {|f, s| [f.sub(%r{^\./}, ''), s]}
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="remove_root-instance_method">
  
    - <strong>remove_root</strong>(name)  <span class="extras">(protected)</span>
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>If a full uri is passed, this removes the root from it otherwise returns the name unchanged</p>

  </div>
</div>
<div class="tags">
  
</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


62
63
64
65
66
67
68</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/importers/filesystem.rb', line 62</span>

def remove_root(name)
  if name.index(@root + "/") == 0
    name[(@root.length + 1)..-1]
  else
    name
  end
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="split-instance_method">
  
    - <strong>split</strong>(name)  <span class="extras">(protected)</span>
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Splits a filename into three parts, a directory part, a basename, and an extension Only the known extensions returned from the extensions method will be recognized as such.</p>

  </div>
</div>
<div class="tags">
  
</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


165
166
167
168
169
170
171
172
173</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/importers/filesystem.rb', line 165</span>

def split(name)
  extension = nil
  dirname, basename = File.dirname(name), File.basename(name)
  if basename =~ /^(.*)\.(#{extensions.keys.map{|e| Regexp.escape(e)}.join('|')})$/
    basename = $1
    extension = $2
  end
  [dirname, basename, extension]
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="to_s-instance_method">
  
    - <strong>to_s</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  
  <h3>See Also:</h3>
  <ul class="see">
    
      <li><a href="Base-3.html#to_s-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Importers/Base.html#to_s-instance_method" title="Sass::Importers::Base#to_s (method)">Base#to_s</a></li>
    
  </ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


46
47
48</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/importers/filesystem.rb', line 46</span>

def to_s
  @root
end</pre>
    </td>
  </tr>
</table>
</div>
    
  </div>

</div>
    
    <div id="footer">
  Generated on Fri Mar  8 20:33:41 2013 by 
  <a href="javascript:if(confirm(%27http://yardoc.org/  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?%27))window.location=%27http://yardoc.org/%27" tppabs="http://yardoc.org/" title="Yay! A Ruby Documentation Tool">yard</a>
  0.5.3 (ruby-1.8.7).
</div>


  <script type="text/javascript">
  var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
  document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
  </script>
  <script type="text/javascript">
  try {
  var pageTracker = _gat._getTracker("UA-535380-8");
  pageTracker._trackPageview();
  } catch(err) {}</script>


  </body>
</html>